package com.rover.system.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.grid.ViewField;


/**
 * 项目附件父表(其他附件表需继承该表)
 */
@Entity
@Table(name = "s_attachment")
public class Attachment extends BaseEntity implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    @ViewField
    private Integer id;
    @ViewField(header = "编号", width = 200)
    private User user;// 创建人
    @ViewField
    private String businessKey;// 业务类主键

    private String subclassname;// 子类名称全路径
    @ViewField(header = "附件名称", width = 200)
    private String attachmenttitle;// 附件名称
    private byte[] attachmentcontent;// 附件内容
    private String realpath;// 附件物理路径
    @ViewField(header = "上传时间", width = 150 ,type="date" ,attributes ="yyyy-MM-dd HH:ss" )
    private Date createdate;
    private String note;
    private String swfpath;// swf格式路径
    private String extend;// 扩展名
    private Long size;//    文件大小
     public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }



    @Column(name = "extend", length = 32)
    public String getExtend() {
        return extend;
    }

    public void setExtend(String extend) {
        this.extend = extend;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "userid")
    public User getUser() {
        return this.user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Column(name = "businesskey", length = 32)
    public String getBusinessKey() {
        return businessKey;
    }

    public void setBusinessKey(String businessKey) {
        this.businessKey = businessKey;
    }

    @Column(name = "attachmenttitle", length = 100)
    public String getAttachmenttitle() {
        return this.attachmenttitle;
    }

    public void setAttachmenttitle(String attachmenttitle) {
        this.attachmenttitle = attachmenttitle;
    }

    @Column(name = "attachmentcontent", length = 3000)
    @Lob
    public byte[] getAttachmentcontent() {
        return this.attachmentcontent;
    }

    public void setAttachmentcontent(byte[] attachmentcontent) {
        this.attachmentcontent = attachmentcontent;
    }

    @Column(name = "realpath", length = 100)
    public String getRealpath() {
        return this.realpath;
    }

    public void setRealpath(String realpath) {
        this.realpath = realpath;
    }


    @Column(name = "createdate", length = 35)
    public Date getCreatedate() {
        return createdate;
    }

    public void setCreatedate(Date createdate) {
        this.createdate = createdate;
    }

    @Column(name = "note", length = 300)
    public String getNote() {
        return this.note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Column(name = "swfpath", length = 300)
    public String getSwfpath() {
        return this.swfpath;
    }

    public void setSwfpath(String swfpath) {
        this.swfpath = swfpath;
    }

    @Column(name = "subclassname", length = 300)
    public String getSubclassname() {
        return subclassname;
    }

    public void setSubclassname(String subclassname) {
        this.subclassname = subclassname;
    }

}
